package com.itheima.io.bufferedreader.demo01;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLOutput;
import java.util.Arrays;

public class BufferedReaderDemo01 {

    public static void main(String[] args) throws IOException {

        BufferedReader bufferedReader = new BufferedReader(new FileReader("itheima-io-bufferedreader\\a.txt"));

//        int ch = -1;
//        while ((ch = bufferedReader.read()) != -1){
//            System.out.print((char)ch);
//        }

        char[] chars = new char[1024];
        int len = -1;
        while ((len = bufferedReader.read(chars)) != -1){
            System.out.println(new String(chars, 0, len));
        }


        bufferedReader.close();

    }
}
